package com.example.yskjproject.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import java.util.Objects;

public class IntentUtils {
    public static void intentApp(Context context, String packageName,View view) {
        Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
        if (launchIntent != null) {
//            ActivityOptions options = ActivityOptions.makeCustomAnimation(context, R.anim.slide_in_bottom, R.anim.fade_out_top);
//            ActivityOptions options = ActivityOptions.makeScaleUpAnimation(view,50,50,50,50);
//            ActivityOptions options = ActivityOptions.makeClipRevealAnimation(view,0,0,0,0);
            context.startActivity(launchIntent);
        }
    }

    public static void intentActivity(Context context, Activity firstActivity, Class activity,String data) {
        Intent intent = new Intent(firstActivity, activity);
        if (!Objects.equals(data, "")) {
            intent.putExtra("data",data);
        }
        context.startActivity(intent);

    }
}
